﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WPFClient
{
    /// <summary>
    /// Pop up box which asks user for name of friend. MainWindow will create the box. When button is pressed, the method in MainWindow will
    /// search for the friend. if successful it will close the window otherwise the window will stay open, done will become false and the user
    /// will have to try again
    /// </summary>
    public partial class AddFriend : Window
    {
        public delegate void DoneHandler();
        public event DoneHandler done;// sends signal that button was pressed
        public AddFriend()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            //when button pressed
            done(); //sends signal
        }
        public String getName()
        {
            //when asked for name
            return textBox1.Text; //returns contents of text box
        }

    }
}
